package com.smartcampusbackend.controller;

import com.smartcampusbackend.service.SparkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/ai")
public class AiChatController {

    @Autowired
    private SparkService sparkService;

    @PostMapping("/ask")
    public String ask(@RequestBody String question){
        return sparkService.ask(question);
    }
}
